#ifndef DATATUNNEL_H
#define DATATUNNEL_H

#include <QObject>

class DataTunnelPrivate;
class DataTunnel : public QObject
{
    Q_OBJECT
public:
    static DataTunnel* instance();

    Q_INVOKABLE void setType(const QString& type);
    QString type() const;

    Q_INVOKABLE void setName(const QString& name);
    QString name() const;

    Q_INVOKABLE void setData(const QList<double>& data);
    Q_INVOKABLE void addData(double data);
    QList<double> data() const;

    Q_INVOKABLE void startDrag();

    bool isEmpty() const;
    void reset();

    void attach(QWidget* graph);
    QWidget* attachedWidget() const;

signals:
    void beginDragging();

private:
    explicit DataTunnel(QObject *parent = 0);
    ~DataTunnel();

    DataTunnelPrivate* d_ptr;
};

#endif // DATATUNNEL_H
